#ifndef	__KEY_H
#define	__KEY_H

#include "cw32l083_gpio.h"
#include "cw32l083_rcc.h"

#define  KEY1_PORT CW_GPIOF
#define  KEY1_PIN  GPIO_PIN_4
#define  KEY2_PORT CW_GPIOA
#define  KEY2_PIN  GPIO_PIN_3

#define KEY1_SATE() PF04_GETVALUE()
#define KEY2_SATE() PA03_GETVALUE()

enum KEY_STATE{NO_CLICKED,CLICKED,DOUBLE_CLICKED,LONG_CLICKED};

struct KEYdataBase
{
   volatile enum KEY_STATE KEY1;	//KEY1 PF04
   volatile enum KEY_STATE KEY2;	//KEY2 PA03
};

struct KEYscanDataBase
{
  uint8_t KEY1_Trg;
  uint8_t KEY1_Cont;
	uint8_t KEY1_num;
  
  uint8_t KEY2_Trg;
  uint8_t KEY2_Cont;
  uint8_t KEY2_num;
};

void KEY_Init(void);
void KEY_Scan(void);

#endif

